# -*- coding: utf-8 -*-
# https://blog.csdn.net/weixin_52040868
# 公众号：测个der
# 微信：qing_an_an


from PyQt5.QtCore import QObject,pyqtSignal

class QTYPE(QObject):
    sendmsg = pyqtSignal(object)

    def __init__(self):
        super(QTYPE, self).__init__()

    def run(self):
        # 发射信号
        self.sendmsg.emit("Hello")

class Slot(QObject):
    def __init__(self):
        super(Slot, self).__init__()

    def get(self,msg):
        print("msg",msg)

if __name__ == '__main__':
    app = QTYPE()
    slot = Slot()
    print("信号半绑定到槽函数")
    app.sendmsg.connect(slot.get)
    app.run()
    print("信号与槽函数断开")
    app.sendmsg.disconnect(slot.get)
    app.run()